package com.etime.perfectschool.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.etime.perfectschool.mapper.JobMapper;
import com.etime.perfectschool.pojo.Job;
import com.etime.perfectschool.service.JobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class JobServiceImpl implements JobService {

    @Autowired
    private JobMapper jobMapper;

    @Override
    public int changJobState(Map<String,Object> map) {
        return jobMapper.changJobState(map);
    }

    @Override
    public List<Job> getAllJob(String jobType) {
        return jobMapper.getAllJob(jobType);
    }

    @Override
    public int deleteJobByJobId(int jobId) {
        return jobMapper.deleteById(jobId);
    }

    @Override
    public int insertJob(Job job) {
        return jobMapper.insert(job);
    }

    @Override
    public Page<Job> getJobByPage(int current,int size) {
        Page<Job> page=new Page<>(current,size);
        return jobMapper.getJobByPage(page);
    }

}
